<template>
  <div>
    <h2 style="font-size: 25px;font-weight: 700;color: black">{{ title }}</h2>
    <v-md-preview :text="postData"></v-md-preview>
  </div>
</template>
<script setup lang="ts">
import {onMounted, ref} from "vue";
import {GetPostById} from "@/api/Note";

const postData = ref("")
const title = ref("")
const props = defineProps({
  id: {
    type: Number,
    default: ""
  }
})
onMounted(async () => {
  const res = await GetPostById(props.id)
  console.log(res.data[0])
  postData.value = res.data[0].content
  title.value = res.data[0].title
})

</script>
<style scoped lang="scss">

</style>